-- version 1.0b

-- ToDo list:
-- Testing

--<<<<<<<<<<<<<<<<<This is a variable used to build logic for Waypoint off load	>>>>>>>>>>>>>
--<<<<<<<<<<<<<<<<<															  	>>>>>>>>>>>>>
MW_WP_Type = false;


	function getQS()
		queststate1 = getQuestStatus(425727); --Wrath of the Forest
		queststate2 = getQuestStatus(425724); --"Need to Know Herbs"
		queststate3 = getQuestStatus(425733); --"Capra and Carts"
		queststate4 = getQuestStatus(425732); --"Pure Nature's Power"
		queststate5 = getQuestStatus(425728); --"Woodland Delirium"
		queststate6 = getQuestStatus(425727); --"Woodland Disgust"
		queststate7 = getQuestStatus(425736); --"Notes from Experience"
		queststate8 = getQuestStatus(425731); --"Conversation Bridge"
		queststate9 = getQuestStatus(425725); --"Miracle Cure"
		queststate10 = getQuestStatus(425734); --"Tilling Hope"
		queststate11 = getQuestStatus(425735); --"Foul Remains"
		queststate12 = getQuestStatus(425730); --"Woodland Distrust"
	end
		
	function onhvst()
		if queststate2 == "incomplete" then
			if player:findNearestNameOrId(121064) then --"common herb"
				player:target_Object(121064)
				yrest(500)
			end
		end
		
		if queststate8 == "incomplete" then
			if player:findNearestNameOrId(121213) then --"Mondtr\164nengras"
				player:target_Object(121213)
				yrest(500) 
			end
		end
			
		if queststate9 == "incomplete" then
			if player:findNearestNameOrId(121066) then --"Goldene Graswurzel"
				player:target_Object(121066)
				yrest(500) 
			end
		end
		
		if queststate10 == "incomplete" then
			if player:findNearestNameOrId(121218) then --Fülle der Erde
				player:target_Object(121218)
				yrest(500) 
			end
		end
	end
		
	function onMobtbl()
		settings.profile.mobs = {} -- Empty List
			
		if queststate1 == "incomplete" then
			table.insert(settings.profile.mobs, 107108) --"Gutai's Wrath"
		end
			
		if queststate3 == "incomplete" then
			table.insert(settings.profile.mobs, 107108) --"Gutai's Wrath"
		end
		
		if queststate5 == "incomplete" then
			table.insert(settings.profile.mobs, 107079) --"Frenzied Form"
		end
		
		if queststate6 == "incomplete" then
			table.insert(settings.profile.mobs, 107083) --"Gutai's Dread"
		end
		
		if queststate7 == "incomplete" then
			table.insert(settings.profile.mobs, 107085) --"Raging Bear"
			table.insert(settings.profile.mobs, 107136) -- "Kaluga Brown Bear"
		end
		
		if queststate11 == "incomplete"  then
			table.insert(settings.profile.mobs, 107108) --"Gutai's Wrath"
			table.insert(settings.profile.mobs, 107079) --"Frenzied Form"
			table.insert(settings.profile.mobs, 107082) --"Gutai's Doubt"
			table.insert(settings.profile.mobs, 107083) --"Gutai's Dread"
		end

		if queststate12 == "incomplete" then
			table.insert(settings.profile.mobs, 107082) --"Gutai's Doubt"
		end		

			
		if #settings.profile.mobs == 0 then
			__WPL:setForcedWaypointType("RUN")
		end
	end
	
	function loadBln()
		if 10 > inventory:itemTotalCount(241311) then --"Balloon Monster Remains"
			loadPaths("MW_Dailies/Balloons_MW_Daily.xml")
		end
	end
	
	function loadmain()
		if 500 == inventory:itemTotalCount(241311) then --"Balloon Monster Remains"
			loadPaths("MW_Dailies/Midnight_Daily.xml")
		end
	end
	
	function goHM()
		if queststate1 == "complete" and queststate2 == "complete" and queststate3 == "complete" and queststate4 == "complete" and 
		queststate5 == "complete" and queststate6 == "complete" and queststate7 == "complete" and queststate8 == "complete" and
        queststate9 == "complete" and queststate10 == "complete" and queststate11 == "complete" and queststate12 == "complete" then
			loadPaths("MW_Dailies/Kaluga_Housemaid.xml");
        end
	end
	
	function goHM2()
		if not player.Mounted then
			player:mount();
		end
	end
	
	function ondaily()
		getQS()
		
		if queststate1 == "incomplete" or queststate3 == "incomplete" or queststate5 == "incomplete" or queststate6 == "incomplete" or 
		queststate7 == "incomplete" or queststate11 == "incomplete" or queststate12 == "incomplete"  then
			print("Mob Target assembly active")
			onMobtbl()
		else
			
			if (MW_WP_Type == false) then
				MW_WP_Type = true;
				__WPL:setForcedWaypointType("RUN")
			end
		end
		
		if queststate2 == "incomplete" or queststate8 == "incomplete" or queststate9 == "incomplete" or queststate10 == "incomplete" then
			print("harvest subsystem active")
			onhvst()
		end
		
	end
	